﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using  System.Web.Razor;
using System.Web.Razor.Parser;
using System.Xml.Schema;
using Microsoft.CSharp;
using RazorEngine;

namespace ConsoleTest
{
    class TestRazor
    {
        public static void Test()
        {
            var model = "hello @Model";
            //var language = new CSharpRazorCodeLanguage();
            //var host = new RazorEngineHost(language);
            //var engine = new RazorTemplateEngine(host);

            //var code = engine.GenerateCode(new StringReader(model));
            //var codeType = code.GeneratedCode.Namespaces[0].Types[0];
            //var codeProvider = new CSharpCodeProvider();
            //var assebly = codeProvider.CompileAssemblyFromDom(null, code.GeneratedCode);
            //var type = assebly.CompiledAssembly.GetType("");
            //Activator.CreateInstance(type);

            var result=Razor.Parse<string>(model,"world", "test");
            Console.WriteLine(result);
        }
    }
}
